import com.yuntu.dao.UserMapper;
import com.yuntu.pojo.User;
import com.yuntu.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class usertest {
    @Test
    public void countTest() throws Exception {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext-mybatis.xml");
        UserMapper userMapper = (UserMapper) applicationContext.getBean("userMapper");
        int cout = userMapper.getCount();
        System.out.println(cout);
    }

    @Test
    public void logintest() throws Exception {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext-mybatis.xml");
        UserMapper userMapper = (UserMapper) applicationContext.getBean("userMapper");
        String code = "123";
        User user =  userMapper.getUserLogin(code);
        System.out.println(user.getId());
    }

    @Test
    public void pageList(){

    }
}
